﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyBlog.Common;
using MyBlog.Entity;
using System.Data;

namespace MyBlog.DAL
{
    public class DAL_ASMX_test
    {
        private static log4net.ILog myLogger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 

        /// <summary>获取当前的版本信息
        /// --Hsppl
        /// </summary>
        /// <returns>当前版本信息</returns>
        public string GetBlogVersion()
        {
            //EntityVersion entityversion = new EntityVersion();
            try
            {
                Entity.EntityVersion entityversion = new EntityVersion();
                DataTable dt = DBHelper.Query("select * from T_Version", DBConfig.connectionString);
                entityversion.version = dt.Rows[0][0].ToString();
                entityversion.lastupdate = (DateTime)dt.Rows[0][1];
                entityversion.lastversion = dt.Rows[0][2].ToString();

                return entityversion.ToString();
            }
            catch(Exception ex)
            {
                myLogger.Error(ex.Message, ex);
                throw;
            }
        }
    }
}
